/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package id3tagger.ui;

import id3tagger.SongDB;
import java.util.ArrayList;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Thomas Monzie
 */
public class ModeleTableAffichage extends DefaultTableModel
{
    public ModeleTableAffichage(String nomColonne)
    {
        super();
        this.addColumn(nomColonne);
    }

    public void insertRow(String nom)
    {
        this.insertRow(this.getRowCount(), new Object[]{nom});
    }

    public void insertList(ArrayList <String> as)
    {
        for(int i = 0; i < as.size(); ++i)
        {
            this.insertRow(as.get(i));
            //System.out.println("ArrayList("+i+") : "+as.get(i));
        }
    }

    public void empty()
    {
        for(int i = this.getRowCount() - 1 ; i>=0; --i)
            this.removeRow(i);
    }

    public void insertRow(SongDB s)
    {
         this.insertRow(this.getRowCount(), new Object[]{s});
    }
}